// execute by 
// > groovy -l 8000 httpserver.groovy

if (init)
  data = "";

if (line.size() > 0) {
  data += line + "\n"
} else {
  print "HTTP/1.0 200 OK\n"
  println "Content-Type: text/plain\n"
  println '''[
  {
    "src": "sina"
    , "title": "SINA - title"
  }
  , {
    "src": "sohu"
    , "title": "SOHU - title"
  }
  , {
    "src": "ntes"
    , "title": "NTES - title"
  }
]
'''
  return "success"
}
